use std::error::Error;
use std::fmt::Display;

#[derive(Debug)]
pub struct EvalError {
    err: String,
}

impl Error for EvalError {}

impl Display for EvalError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "Evaluate error: {}", self.err)
    }
}

impl EvalError {
    pub fn new(err: String) -> Self {
        Self { err }
    }
}